package battleship.cxbr;

import java.util.ArrayList;

import battleship.emss.*;

public class BaseContext extends Context
{
	public BaseContext(String n,CxBRAgent a)
	{
		super(n,a);
	}
	
	//How to get here from above
	public double ParentRule(double Time)
	{
		return 0.0;
	}
	//How to get here from side
	public double SiblingRule(double Time)
	{
		return 0.0;
	}
	
	//Things to do when just entering
	public void Initialize(double Time)
	{
	}
	
	//What do actually do
	public void Action(double Time)
	{
		Agent.status.status="Elbonia";
		Agent.actions.clear();
		
		//Base only looks for things in its actions
		//Sends out communications
		for(int i=0;i<Agent.detectedStatus.size();i++)
		{
			Status tmpStatus=Agent.detectedStatus.get(i);
			//not on my team
			//and a Sub 
			
			if(tmpStatus.team!=Agent.status.team && tmpStatus.type==Agent.SUB)
			{
					Agent.status.status+=" Detect";
					Agent.outgoingMessages.add(new Message("Sub1","Blue Sub Detected"));
					//System.out.println("Detected Sub Agent");
			}
		}		
		
		
		return;
	}
	
}

